home *** CD-ROM | disk | FTP | other *** search
/ Clickx 75 / Clickx 75.iso / software / expressionweb / expressionwebv3 / ExpressionWeb_en.exe / Setup / WeComn.cab / xWeb.fpeditax.dll / HTML / 539 < prev    next >
Encoding:
Extensible Markup Language  |  2009-07-15  |  987 b   |  35 lines

  1. <xsl:stylesheet 
  2.     xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
  3.     version="1.0">
  4. <xsl:output method="xml" indent="yes" encoding="utf-8" />
  5.  
  6. <xsl:template match="/">
  7.     <Repeats>
  8.     <xsl:apply-templates select="*" />
  9.     </Repeats>
  10. </xsl:template>
  11.  
  12. <xsl:template match="*">
  13.     <xsl:if test="(*[1] | @*[1] | text()) and name() != name(preceding-sibling::*[1])">
  14.         <xsl:variable name="repeating" select="following-sibling::*[name() = name(current())]"/>
  15.         <xsl:if test="count($repeating)">
  16.             <xsl:variable name="XPath">
  17.                 <xsl:call-template name="GetXPath" />
  18.             </xsl:variable>
  19.             <Repeat Name="{name()}" Path="{$XPath}" />
  20.         </xsl:if>
  21.         <xsl:apply-templates select="*"/>
  22.     </xsl:if>
  23. </xsl:template>
  24.  
  25. <xsl:template match="@*|text()|comment()|processing-instruction()"/>
  26.  
  27. <xsl:template name="GetXPath">
  28.     <xsl:for-each select="ancestor-or-self::*">
  29.         <xsl:text>/</xsl:text>
  30.         <xsl:value-of select="name()" />
  31.     </xsl:for-each>
  32. </xsl:template>
  33.  
  34. </xsl:stylesheet>
  35.